﻿using System;
using System.Data.SqlClient;
using System.Configuration;
using System.Text;
using System.Data;

namespace NIIT.SaoBacDau.Aupi.HospitalManagement.DataAccess
{
    public class DAO_ConnectDatabase
    {
        public static SqlConnection Connect()
        {
            string ConString = ConfigurationManager.ConnectionStrings["HospitalManagement"].ConnectionString;
            SqlConnection sqlcon = new SqlConnection(ConString);
            try
            {
                sqlcon.Open();
            }
            finally
            {
                if (sqlcon.State == ConnectionState.Open)
                    sqlcon.Close();
            }
            return sqlcon;
        }
    }
}
